<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Cart Page - Ustora Demo</title>
    
    <!-- Google Fonts -->
    <link href='https://fonts.googleapis.com/css?family=Titillium+Web:400,200,300,700,600' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Roboto+Condensed:400,700,300' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Raleway:400,100' rel='stylesheet' type='text/css'>
    
    <!-- Bootstrap -->
    <link rel="stylesheet" href="${request.contextPath}/css/bootstrap.min.css">
    
    <!-- Font Awesome -->
    <link rel="stylesheet" href="${request.contextPath}/css/font-awesome.min.css">
    
    <!-- Custom CSS -->
    <link rel="stylesheet" href="${request.contextPath}/css/owl.carousel.css">
    <link rel="stylesheet" href="${request.contextPath}/style.css">
    <link rel="stylesheet" href="${request.contextPath}/css/responsive.css">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body>
   
    <div class="header-area">
        <div class="container">
            <div class="row">
                <div class="col-md-8">
                    <div class="user-menu">
                        <ul>
                            <li><a href="http://localhost:8010/shophome1"><i class="fa fa-user"></i>主页</a></li>
                            <li><a href="http://localhost:8010/person"><i class="fa fa-heart"></i>个人中心</a></li>
                            <li><a href="http://localhost:8010/cart"><i class="fa fa-user"></i>购物车</a></li>
                            <li><a href="http://localhost"><i class="fa fa-user"></i>登录</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div> <!-- End header area -->
    <!-- End site branding area -->
    
    <div class="mainmenu-area">
        <div class="container">
            <div class="row">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                </div>
            </div>
        </div>
    </div> <!-- End mainmenu area -->
    
    <div class="product-big-title-area">
        <div class="container">
            <div class="row">
                <div class="col-md-12">
                    <div class="product-bit-title text-center">
                        <h2>购物车</h2>
                    </div>
                </div>
            </div>
        </div>
    </div> <!-- End Page title area -->
    
    
    <div class="single-product-area">
        <div class="zigzag-bottom"></div>
        <div class="container">
            <div class="row">
                <div class="col-md-4">
                    <div class="single-sidebar">
                        <h2 class="sidebar-title">搜素商品</h2>
                        <form action="#">
                            <input type="text" placeholder="Search products...">
                            <input type="submit" value="Search">
                        </form>
                    </div>
                    
                    <div class="single-sidebar">
                        <h2 class="sidebar-title">商品</h2>
                        <div class="thubmnail-recent">
                            <img src="${request.contextPath}/img/product-thumb-1.jpg" class="recent-thumb" alt="">
                            <h2><a href="singleproduct.ftl">手机--2019-02-05</a></h2>
                            <div class="product-sidebar-price">
                                <ins>$700.00</ins> <del>$800.00</del>
                            </div>
                        </div>
                    </div>

                </div>
                
                <div class="col-md-8">
                    <div class="product-content-right">
                        <div class="woocommerce">
                            <form>
                                <table cellspacing="0" class="shop_table cart">
                                    <thead>
                                        <tr>
                                            <th class="product-remove">&nbsp;</th>
                                            <th class="product-name">商品</th>
                                            <th class="product-price">价钱</th>
                                            <th class="product-quantity">个数</th>
                                            <th class="product-subtotal">总价</th>
                                            <th class="product-subtotal">删除操作</th>
                                            <th class="product-subtotal">修改操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    <#if itemList??>
                                        <#list itemList as list>
                                        <tr class="cart_item">
                                            <td>

                                            </td>
                                            <td class="product-thumbnail">
                                                <a href="singleproduct.ftl"><img width="145" height="145" alt="poster_1_up" class="shop_thumbnail" src="img/product-thumb-2.jpg"></a>
                                            </td>

                                            <td class="product-price">
                                                <span class="amount">￥${list.price}</span>
                                            </td>

                                            <td class="product-quantity">
                                                <div class="quantity buttons_added">
                                                    <input type="number" size="4" class="input-text qty text" title="Qty" value="${list.cartcount}" min="0" step="1" id="counts" name = "counts">
                                                </div>
                                            </td>

                                            <td class="product-subtotal">
                                                <span class="amount">￥${list.price}</span>
                                            </td>
                                            <td>
                                                <a href = "deletes/iid/${list.iid}">删除</a>
                                            </td>
                                            <td>
                                                <button id="update" onclick="updates(${list.iid})">修改</button>
                                            </td>
                                        </tr>
                                        </#list>
                                    <tr>
                                        <td class="actions" colspan="6">
                                            <a href = "/shoptheall">提交购物车</a>
                                        </td>
                                    </tr>
                                    </#if>
                                    </tbody>
                                </table>
                            </form>

                            <script>

                                function updates(iid) {
                                    var counts = document.getElementById("counts").value;
                                    $.ajax({
                                        url:"/updates/iid/"+iid+"/counts/"+counts,
                                        dataType:"text",
                                        type:"post",
                                        success:function (data) {
                                            alert(data);
                                        }
                                    })
                                }
                            </script>

                            <div class="cart-collaterals">
                            <div class="cross-sells">
                                <h2>你可能还喜欢</h2>
                                <ul class="products">
                                    <li class="product">
                                        <a href="singleproduct.ftl">
                                            <img width="325" height="325" alt="T_4_front" class="attachment-shop_catalog wp-post-image" src="img/product-2.jpg">
                                            <span class="price"><span class="amount">$20.00</span></span>
                                        </a>
                                    </li>

                                    <li class="product">
                                        <a href="singleproduct.ftl">
                                            <img width="325" height="325" alt="T_4_front" class="attachment-shop_catalog wp-post-image" src="img/product-4.jpg">
                                            <span class="price"><span class="amount">$20.00</span></span>
                                        </a>
                                    </li>
                                </ul>
                            </div>

                            <div class="cart_totals ">
                                <h2>购物结算</h2>

                                <table cellspacing="0">
                                    <tbody>
                                        <tr class="cart-subtotal">
                                            <th>购物车此刻钱数</th>
                                            <td><span class="amount">￥${priceTotal}</span></td>
                                        </tr>

                                    </tbody>
                                </table>
                            </div>

                            </div>
                        </div>                        
                    </div>                    
                </div>
            </div>
        </div>
    </div>



    <!-- Latest jQuery form server -->
    <script src="https://code.jquery.com/jquery.min.js"></script>
    
    <!-- Bootstrap JS form CDN -->
    <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
    
    <!-- jQuery sticky menu -->
    <script src="${request.contextPath}/js/owl.carousel.min.js"></script>
    <script src="${request.contextPath}/js/jquery.sticky.js"></script>
    
    <!-- jQuery easing -->
    <script src="${request.contextPath}/js/jquery.easing.1.3.min.js"></script>
    
    <!-- Main Script -->
    <script src="${request.contextPath}/js/main.js"></script>
  <script src="${request.contextPath}/js/jquery-1.11.0.js"></script>
  </body>
</html>